First, given a surface and two points $A,B$ on it, we can conceive a geodesic like the (in some sense locally) shortest curve joining $A$ and $B$.
But there is other underlying idea behind geodesics. They are the straightest lines inside the surface. That is, they are the curves with less curvature: the curve necessarily have the normal curvature provided by the surface so we only can control the geodesic curvature. These curves appears to be straight lines to the inhabitants of the surface, in the sense that their geodesic curvature is 0.
These two motivations are related. Following @needham2021visual page 118, if the curve is the shortest posible joining any two points on it, the normal vector, which in some sense can be "feeling" like the "restorative force" of the curve, must point perpendicularly to the surface, since if not the curve wouldn't be the shortest posible. Therefore, all the curvature of the curve is in the normal curvature component (see normal and geodesic curvature of a curve) and therefore the geodesic curvature is zero.
Possibly related: curvature like a driving force.
Another motivational idea: if the geodesic is traced on the surface of a fruit and then is peeled from the surface and laid flat on the table it becomes a straight line (@needham2021visual pages 13-14).
Definition 1
Given a pseudo-Riemannian manifold, a geodesic it is a curve such that the geodesic curvature is cero.
$\blacksquare$
Definition 2
Another approach. Consider that we have a manifold $M$ and a covariant derivative operator $\nabla$. A curve $\gamma$ is a geodesic if the vector field $v=\gamma'(t)$ defined along $\gamma$ is constant along $\gamma$, that is,
$$ D_v v=0, $$where $D$ is the covariant derivative along a curve.
$\blacksquare$
These definitions are equivalent. There is a weaker definition, in which the speed of the geodesic is not constant, only the direction is. In that case, they are defined by
$$ D_v v=\alpha v, $$for certain function $\alpha$ defined on the image of the curve, $\gamma([0,1])$. They are called pregeodesics.
Proposition
Given a manifold $M$ with a covariant derivative $\nabla$, let $p\in M$ and $\xi\in T_p M$. There exists a unique geodesic $\gamma:I\rightarrow M$ such that $\gamma(0)=p$, $\gamma'(0)=\xi$, and it is maximal in the following sense: if there is another curve satisfying the same conditions, its domain is contained in $I$, and they coincide on the intersection.
$\blacksquare$
Proof
Existence and uniqueness of parallel transport (see here).
$\blacksquare$
To compute a geodesic curve we use the Christoffel symbols. The geodesic equations are second order equations given by:
$$ \frac{d^2 x^i}{dt^2} + \Gamma^i_{jk} \frac{dx^j}{dt}\frac{dx^k}{dt} = 0 $$In two dimensions:
Sure, in a 2-dimensional Riemannian manifold, where $i, j, k \in \{1, 2\}$, the geodesic equations will be given as follows:
$$ \frac{d^2 x^1}{dt^2} + \Gamma^1_{11} \frac{dx^1}{dt}\frac{dx^1}{dt} + \Gamma^1_{12} \frac{dx^1}{dt}\frac{dx^2}{dt} + \Gamma^1_{21} \frac{dx^2}{dt}\frac{dx^1}{dt} + \Gamma^1_{22} \frac{dx^2}{dt}\frac{dx^2}{dt} = 0 $$ $$ \frac{d^2 x^2}{dt^2} + \Gamma^2_{11} \frac{dx^1}{dt}\frac{dx^1}{dt} + \Gamma^2_{12} \frac{dx^1}{dt}\frac{dx^2}{dt} + \Gamma^2_{21} \frac{dx^2}{dt}\frac{dx^1}{dt} + \Gamma^2_{22} \frac{dx^2}{dt}\frac{dx^2}{dt} = 0 $$This simplifies further by noting that the Christoffel symbols are symmetric in the lower indices, i.e. $\Gamma^i_{jk} = \Gamma^i_{kj}$, so we have:
$$ \frac{d^2 x^1}{dt^2} + \Gamma^1_{11} \left(\frac{dx^1}{dt}\right)^2 + 2 \Gamma^1_{12} \frac{dx^1}{dt}\frac{dx^2}{dt} + \Gamma^1_{22} \left(\frac{dx^2}{dt}\right)^2 = 0 $$ $$ \frac{d^2 x^2}{dt^2} + \Gamma^2_{11} \left(\frac{dx^1}{dt}\right)^2 + 2 \Gamma^2_{12} \frac{dx^1}{dt}\frac{dx^2}{dt} + \Gamma^2_{22} \left(\frac{dx^2}{dt}\right)^2 = 0 $$Here $x^1$ and $x^2$ are the coordinates of the 2-dimensional Riemannian manifold.
________________________________________
________________________________________
________________________________________
Author of the notes: Antonio J. Pan-Collantes
INDEX: